import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsOptional, IsEnum } from 'class-validator';
import { PaymentStatus } from '../entities/user-recharge.entity';

/**
 * 支付回调DTO
 */
export class PaymentCallbackDto {
  @ApiProperty({ description: '订单号', example: 'ORDER_20231201_123456' })
  @IsString()
  orderNo: string;

  @ApiProperty({ description: '第三方支付订单号', example: 'WX_20231201_789012' })
  @IsString()
  thirdPartyOrderNo: string;

  @ApiProperty({ 
    description: '支付状态', 
    enum: PaymentStatus,
    example: PaymentStatus.PAID 
  })
  @IsEnum(PaymentStatus)
  paymentStatus: PaymentStatus;

  @ApiProperty({ description: '失败原因', required: false })
  @IsOptional()
  @IsString()
  failureReason?: string;

  @ApiProperty({ description: '签名', example: 'abc123def456' })
  @IsString()
  signature: string;
}